package com.example.dataservice.mapper;

import org.apache.ibatis.annotations.Select;
import org.example.api.model.IncomeRecord;

import java.util.Date;
import java.util.List;

public interface IncomeRecordMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(IncomeRecord record);

    int insertSelective(IncomeRecord record);

    IncomeRecord selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(IncomeRecord record);

    int updateByPrimaryKey(IncomeRecord record);

    @Select("""
            select * from b_income_record
            where income_status = 0
            and income_date = #{pre}
            """)
    /*到期的收益记录*/
    List<IncomeRecord> selectExpiredIncome(Date pre);
}